<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">

    <form class="form-horizontal m" id="form-orderAudit-edit" th:object="${user}">

        <input id="id" name="id" th:value="*{id}" type="hidden">

        <div class="form-group">
            <label class="col-sm-3 control-label">金额：</label>
            <div class="col-sm-8">
                <input id="money" name="money"  class="form-control" type="text" onkeyup="check()"/>
            </div>
        </div>

    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "module/user";
    $("#form-orderAudit-edit").validate({
        rules: {
            xxxx: {
                required: true,
            },
        }
    });
    
    function  check() {
        var reg = /^[0-9]*[1-9][0-9]*$/;
        var money = document.getElementById("money").value;
        if(!reg.test(money)){
            return $.modal.alertError("金额格式不正确");
        }
    }

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/reduceMoney", $('#form-orderAudit-edit').serialize());
        }
    }
</script>
</body>
</html>
